<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html>
<html lang="zh-CN">
	<head>
    <title>管理入口-用户信息列表</title>
    
    <%@ include file="../common.jsp" %>
	<script type="text/javascript" src="${path }/static/vender/jquery/jquery.pagination.js"></script>
	<script type="text/javascript" src="${path }/static/vender/bootstrap/bootstrap-switch.js"></script>
    <link href="${path }/static/vender/bootstrap/bootstrap-switch.min.css" rel="stylesheet">
	
<style type="text/css">
.dev_text {
color:red;
margin: 5px;
}
.dev_item {
margin: 20px;
}
.dev_item .control-label{
text-align: right;
margin-top: 10px;
}
.input_edit {color:red}
.input_readonly {color:blue}
</style>

  </head>

  <body>
	<jsp:include page="${pagePath }/header.jsp">
		<jsp:param value="2" name="active"/>
	</jsp:include>
  	
    <div class="container-fluid">
      <div class="row">
      	<div class="col-sm-3 col-md-2 sidebar">
			<jsp:include page="left_navbar.jsp">
				<jsp:param value="1" name="active"/>
			</jsp:include>
		</div>
		
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2">
        	<form id="formId" action="./save" method="POST">
	        	<div class="form-group">
	              <div id="msgDiv" class="alert alert-warning" style="display:none;" role="alert"></div>
	            </div>
	        	<ul id="myTab" class="nav nav-tabs">
					<li class="active">
						<a href="#baseCfg" data-toggle="tab">基础信息</a>
					</li>
					<li><a href="#extCfg" data-toggle="tab">高级配置</a></li>
				</ul>
				
				<div id="myTabContent" class="tab-content">
					<div class="tab-pane fade in active" id="baseCfg">
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">设备编号</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" check-type="required" name="devNo" ${dev.devNo==null?"":"disabled" } value="${dev.devNo }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">设备名称</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" check-type="required" name="devName" value="${dev.devName }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">探针MAC列表</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="macList" check-type="required" value="${dev.macList }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">设备版本</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="devVersion" value="${dev.devVersion }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">经度</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="longitude" value="${dev.longitude }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">纬度</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="latitude" value="${dev.latitude }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">地址</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="addr" value="${dev.addr }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">备注</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="remark" value="${dev.remark }" >
					    </div>
					  </div>
					</div>
					
					<div class="tab-pane fade" id="extCfg">
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">NTP服务器地址</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="ntpSrv" value="${cfg.ntpSrv }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">上报周期 </label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="upPeriod" value="${cfg.upPeriod }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">管理服务器 URL</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="mscSrv" value="${cfg.mscSrv }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">数据服务器地址</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="dscSrv" value="${cfg.dscSrv }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">数据通道回传模式</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="dataTransMode" value="${cfg.dataTransMode }" > --%>
					      <div tabindex="0" >
				                <input class=""  name="dataTransMode" value="${cfg.dataTransMode==1?'1':'0' }" type="checkbox" ${cfg.dataTransMode==1?'':'checked'}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">信道调度模式</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="chMode" value="${cfg.chMode }" > --%>
					      <div tabindex="0" >
				                <input class=""  name="chMode" value="${cfg.chMode==1?'1':'0' }" type="checkbox" ${cfg.chMode==1?'':'checked'}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">信道工作参数</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="chParm" value="${cfg.chParm }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">MAC采集工作开关</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="switchMac" value="${cfg.switchMac }" > --%>
					       <div tabindex="0">
				                <input class="switch" name="switchMac" value="${cfg.switchMac==1?'1':'0' }" type="checkbox" checked="checked" />
				           </div>
				           <br />
					    </div>
					  </div>
					  
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">虚拟身份采集开关</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="switchApp" value="${cfg.switchApp }" > --%>
					      <div tabindex="0">
				                <input class="switch" name="switchApp" value="${cfg.switchApp==1?'1':'0' }" type="checkbox" ${cfg.switchApp==0?'':'checked'}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">ap 信息开关</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="filterAp" value="${cfg.filterAp }" > --%>
					      <div tabindex="0">
				                <input class="switch" name="filterAp" value="${cfg.filterAp }" type="checkbox" ${cfg.filterAp==1?'checked':''}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">station信息过滤器</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="filterSta" value="${cfg.filterSta }" > --%>
					      <div tabindex="0">
				                <input class="switch" name="filterSta" value="${cfg.filterSta==1?'1':'0' }" type="checkbox" ${cfg.filterSta==1?'checked':''}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">tag 信息过滤器</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="filterTag" value="${cfg.filterTag }" > --%>
					      <div tabindex="0">
				                <input class="switch" name="filterTag" value="${cfg.filterTag==1?'1':'0' }" type="checkbox" ${cfg.filterTag==1?'checked':''}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">组播包过滤器</label>
					    <div class="col-sm-10">
					      <%-- <input type="text" class="form-control dev_text" name="filterMulticast" value="${cfg.filterMulticast }" > --%>
					      <div tabindex="0">
				                <input class="switch" name="filterMulticast" value="${cfg.filterMulticast==1?'1':'0' }" type="checkbox" ${cfg.filterMulticast==1?'checked':''}/>
				          </div>
				          <br />
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">设备移动轨迹上报周期</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="devLocusInvl" value="${cfg.devLocusInvl }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">设备基础信息上报周期</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="devBasicInvl" value="${cfg.devBasicInvl }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">状态信息服务器地址</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="devStateSrv" value="${cfg.devStateSrv }" >
					    </div>
					  </div>
					  <div class="form-group dev_item">
					    <label class="col-sm-2 control-label">设备状态信息上报周期</label>
					    <div class="col-sm-10">
					      <input type="text" class="form-control dev_text" name="devStateInvl" value="${cfg.devStateInvl }" >
					    </div>
					  </div>
					</div>
					
					<div class="">
					  <div class="form-group">
					    <input  id="saveBtn" type="submit" class="btn btn-primary" style="float: right; margin-top: 22px;" value="保存" />
					  </div>
					</div>
				</div>
			</form>
        </div>
      </div>
    </div>
    
    <input id="hadSynchronized" type="hidden" value="${cfg.hadSynchronized }">
	<jsp:include page="${pagePath }/footer.jsp"></jsp:include>

	<script type="text/javascript">
		$(function(){
			if($('#hadSynchronized').val() === 'false') {
				$('#msgDiv').text('配置信息尚未同步到采集设备。').show();
			}
		});
	</script>
	<script type="text/javascript" src="${path }/static/js/device/detail.js"></script>
</body></html>